<template>
  <section>
    <!--<el-input id='333' class="sign" style="width: 500px" size="mini" v-model="qrCodeInfor" :autofocus="true" @change="handleInfor"-->
              <!--type="textarea"-->
              <!--@keydown.native.prevent.enter="confirmScann"></el-input>-->
    <el-button size="mini" @click="confirmScann"> 测试 </el-button>
  </section>
</template>

<script>
  import {mapGetters, mapActions, mapMutations} from 'vuex'
  import errHandler from '@/assets/errHandler.js'
  import Vue from 'vue'//后续添加属性，需要vue联动
  export default {
    name: "index",
    data(){
      return{
        qrCodeInfor:null,
        idcode:333,
        signInfor:null
      }
    },
    created(){
      this.signInfor={
        clientId: 12,
        data: {
          userToken: 'c2f4d0da-f95a-4b3f-aeb5-9030295f2f58',
          classId:6,
          customerId: 16
        },
        time: 1564552611723,
        type: "course"
      }
    },
    methods:{
      ...mapActions({
        fetch: 'fetch'
      }),
      confirmScann(){
        this.adminScan(this.signInfor.data)
      },
      adminScan(data){
        this.fetch({name:"adminScan",data})
          .then(res=>{
            console.log('class里的课时签到-----------',res)
            this.$message({type:'success',message:'签到成功！'})
          })
          .catch(err=>{
            console.log(err)
            errHandler.handle(this,err)
          })
      },
      handleInfor(e){
        console.log('估计是一大段------------',e)
      }
    }
  }
</script>

<style scoped>

</style>
